package com.taotao.thrift;

import com.taotao.thrift.generated.DataException;
import com.taotao.thrift.generated.Person;
import com.taotao.thrift.generated.PersonService;
import org.apache.thrift.TException;

/**
 * @Description: PersonService实现类
 * @Author: Chris
 * @Date: Created in 2018/9/21 下午11:37
 */
public class PersonServiceImpl implements PersonService.Iface {
    @Override
    public Person getPersonByUsername(String username) throws DataException, TException {
        System.out.println("Got Client Param：" + username);

        //构建返回对象；
        Person person = new Person();
        person.setUsername(username);
        person.setAge(28);
        person.setMarried(false);

        return person;
    }

    @Override
    public void savePerson(Person person) throws DataException, TException {
        System.out.println("Save Client Person Data");

        System.out.println(person.toString());
    }

}
